/*
 * @lc app=leetcode.cn id=1773 lang=typescript
 *
 * [1773] 统计匹配检索规则的物品数量
 */

// @lc code=start
function countMatches(
    items: string[][],
    ruleKey: string,
    ruleValue: string
): number {
    const list = ["type", "color", "name"];
    return items.filter((i) => {
        return i[list.indexOf(ruleKey)] === ruleValue;
    }).length;
}
// @lc code=end
